#ifndef STATIONPOINT_H
#define STATIONPOINT_H

#include <QWidget>
#include <QPushButton>
#include "qcustomplot.h"
#include "stationinfo.h"
#include <QPointF>

namespace Ui {
class StationPoint;
}

class StationPoint : public QPushButton
{
    Q_OBJECT

public:
    explicit StationPoint(int staSeq,QString name, QPointF _pos, QCustomPlot* _plot, QWidget *parent = 0);
    ~StationPoint();
    QPointF getPos();//获取坐标
    bool getState();//获取状态
    void setState(bool state);//设置状态
    void setIndex(int index);//设置下标
    int mapIndex();//获取下标

public slots:
    void updatePosition();

private slots:
    void goOrNot(bool);
    void on_StationPoint_clicked();

    void on_StationPoint_toggled(bool checked);

signals:
    void gotoPos(QPointF, int);

private:
    Ui::StationPoint *ui;
    bool passed;
    bool checkLock;
    int _index;
    int stationIndex;

    QPointF pos;
    QCustomPlot* plot;
    StationInfo* info;

    void nextCheckState();
};

#endif // STATIONPOINT_H
